import React, { Component } from 'react'

export default class Count extends Component {
  constructor() {
    super()
    this.state = {
      c: 0,
      msg: 'hello state',
    }
    this.handle = this.handle.bind(this)
  }

  handle() {
    this.setState({
      c: this.state.c + 1,
    })
  }

  render() {
    return (
      <div>
        <p>{this.state.c}</p>
        <p>{this.state.msg}</p>
        <button onClick={this.handle}>+</button>
      </div>
    )
  }
}
